/*
 * 文件名：StreamCalcruleDaoImpl.java
 * 版权：亚信联创版权所有
 * 描述：TODO
 * 修改人：napo
 * 修改时间：2015-1-13
 * 修改内容：TODO
 */
package com.ailk.bigdata.etl.realstream.server.dao.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.ailk.bigdata.etl.realstream.server.dao.StreamCalcruleDao;
import com.ailk.bigdata.etl.realstream.server.model.FilterColumn;

/**
 * @description TODO
 * @author [napo]
 * @version [版本号,2015-1-13]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class StreamCalcruleDaoImpl implements StreamCalcruleDao
{
	private static Logger logger = LoggerFactory.getLogger(StreamCalcruleDaoImpl.class);
	private static final String getCalcFilterColumn;

	static
	{
		StringBuilder sbuilder = new StringBuilder();
		sbuilder.append("SELECT * FROM td_filter_column WHERE column_id in");
		sbuilder.append("(");
		sbuilder.append("select column_id from td_realstream_column_filter where stream_rule_id=");
		sbuilder.append("(");
		sbuilder.append("select t1.stream_rule_id from td_unit_calc t1 left join td_stream_calcrule t2 on t1.stream_rule_id=t2.stream_rule_id where t1.stream_rule_id=? and t2.rule_type=?");
		sbuilder.append(")");
		sbuilder.append(")");
		getCalcFilterColumn = sbuilder.toString();
	}

	public List<FilterColumn> getFilterColumnsByonlyUnitCode(long onlyUnitCode)
	{
		logger.info("查询过滤字段sql是[" + getCalcFilterColumn + "]");
		return null;
	}

}
